/* src/styles/chat-style.css */

/* 导航栏样式 */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background-color: #fff;
}

.navbar .statusBar {
  background-color: #fff;
}

.titleBar {
  display: flex;
  align-items: center;
  width: 100%;
  border-bottom: 1rpx solid #f5f5f5;
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  padding: 0 16rpx;
}

.back-icon, .delete-icon {
  cursor: pointer;
}

.back-icon {
  margin-right: 16rpx;
}

.title-section {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.title-section .title {
  font-size: 32rpx;
  font-weight: bold;
  color: #333;
}

.delete-icon {
  margin-left: 16rpx;
}

.fill {
  height: 100px;
}

/* 聊天列表样式 */
.chat-list {
  background-color: #f5f5f5;
  padding-left: 20rpx;
  padding-right: 20rpx;
  padding-bottom: 20rpx;
}

/* 消息项样式 */
.chat-item {
  margin-bottom: 30rpx;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* 左右消息样式 */
.left, .right {
  display: flex;
  align-items: flex-start;
}

.right {
  margin-right: 20px;
  justify-content: flex-end;
  margin-left: auto;
}

/* 头像样式 */
.avatar {
  width: 80rpx;
  height: 80rpx;
  border-radius: 12rpx;
}

.left .avatar {
  margin-right: 10rpx;
}

.right .avatar {
  margin-left: 10rpx;
}

/* 消息内容容器 */
.message-content {
  position: relative;
  padding: 15rpx 20rpx;
  border-radius: 16rpx;
  max-width: 70%;
  word-break: break-word;
}

.left .message-content {
  background-color: #fff;
  box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
}

.right .message-content {
  background-color: #007AFF;
  color: #fff;
  box-shadow: 0 2rpx 8rpx rgba(0, 122, 255, 0.2);
}

/* 消息文本样式 */
.message-text {
  font-size: 28rpx;
  line-height: 1.6;
}

/* 图片消息样式 */
.message-image {
  height: 200px;
  max-width: 70%;
  border-radius: 12rpx;
  box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
  margin-bottom: 10rpx;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.message-image:hover {
  transform: scale(1.02);
}

.left-image {
  margin-right: 10rpx;
}

.right-image {
  margin-left: 10rpx;
}

/* 底部导航栏样式 */
.bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #fff;
  padding: 16rpx 20rpx;
  border-top: 1rpx solid #eee;
  box-sizing: border-box;
  box-shadow: 0 -1rpx 4rpx rgba(0,0,0,0.05);
  transition: transform 0.3s ease;
  z-index: 90;
}

.bottom-icon {
  width: 72rpx;
  height: 72rpx;
  padding: 12rpx;
  box-sizing: border-box;
  cursor: pointer;
}

/* 输入框样式 */
.custom-input {
  flex: 1;
  height: 72rpx;
  margin: 0 16rpx;
  padding: 0 24rpx;
  font-size: 28rpx;
  background-color: #f2f2f2;
  border: 1rpx solid #e0e0e0;
  border-radius: 40rpx;
  box-sizing: border-box;
  transition: all 0.3s ease;
  box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.05);
}

.custom-input::placeholder {
  color: #999;
  font-size: 26rpx;
}

.custom-input:focus {
  outline: none;
  border-color: #007AFF;
  box-shadow: 0 0 0 3rpx rgba(0, 122, 255, 0.2);
  background-color: #fff;
  transform: translateY(-2rpx);
}

/* 按住说话样式 */
.hold-speak {
  flex: 1;
  height: 72rpx;
  margin: 0 16rpx;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 28rpx;
  background-color: #f2f2f2;
  border: 1rpx solid #e0e0e0;
  border-radius: 36rpx;
  box-sizing: border-box;
  color: #333;
}

/* 加号弹出层样式 */
.popup-box {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #fff;
  border-top-left-radius: 16rpx;
  border-top-right-radius: 16rpx;
  box-sizing: border-box;
  z-index: 100;
  will-change: transform;
  height: 200px;
}

.popup-box.hide {
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.popup-box.show {
  transform: translateY(0);
  transition: transform 0.3s ease;
}

.popup-content {
  display: flex;
  flex-wrap: wrap;
  padding: 16rpx;
}

.popup-group {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
}

.popup-item {
  width: 25%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24rpx 0;
  cursor: pointer;
}

.popup-icon {
  width: 60rpx;
  height: 60rpx;
  margin-bottom: 12rpx;
  border-radius: 10rpx;
}

.popup-text {
  font-size: 28rpx;
  color: #333;
  font-weight: 500;
}

/* 表情弹出层样式 */
.emoji-popup-box {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #fff;
  border-top-left-radius: 16rpx;
  border-top-right-radius: 16rpx;
  box-sizing: border-box;
  z-index: 100;
  will-change: transform;
  height: 200px;
}

.emoji-popup-box.hide {
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.emoji-popup-box.show {
  transform: translateY(0);
  transition: transform 0.3s ease;
}

.emoji-scroll {
  height: 100%;
}

.emoji-content {
  display: flex;
  flex-wrap: wrap;
  padding: 16rpx;
}

.emoji-item {
  width: 20%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12rpx 0;
  cursor: pointer;
}

.emoji-char {
  font-size: 40rpx;
}

/* 文件消息样式 */
.file {
  display: flex;
  align-items: center;
  background-color: #fff;
  padding: 12rpx 18rpx;
  border-radius: 16rpx;
  box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
  max-width: 70%;
}

.file-name {
  flex: 1;
  font-size: 28rpx;
  color: #333;
  line-height: 1.4;
  word-break: break-word;
  margin-right: 12rpx;
}

.file image {
  width: 50rpx;
  height: 50rpx;
  border-radius: 8rpx;
}

/* 语音消息样式 */
.audio {
  display: flex;
  align-items: center;
  max-width: 70%;
}

.left .audio {
  margin-left: 10rpx;
}

.right .audio {
  margin-right: 10rpx;
}

.audio-bubble {
  display: flex;
  align-items: center;
  padding: 16rpx 24rpx;
  border-radius: 16rpx;
  position: relative;
}

.left .audio-bubble {
  background-color: #fff;
  box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
}

.right .audio-bubble {
  background-color: #007AFF;
  box-shadow: 0 2rpx 8rpx rgba(0, 122, 255, 0.2);
}

.voice-wave {
  display: flex;
  align-items: center;
  margin-right: 12rpx;
}

.voice-bar {
  width: 6rpx;
  height: 36rpx;
  background-color: #999;
  border-radius: 3rpx;
  margin: 0 2rpx;
  animation: voiceWave 1.5s infinite ease-in-out;
}

.right .voice-bar {
  background-color: #fff;
}

.left .audio-bubble .voice-bar:first-child { animation-delay: 0s; }
.left .audio-bubble .voice-bar:nth-child(2) { animation-delay: 0.1s; }
.left .audio-bubble .voice-bar:nth-child(3) { animation-delay: 0.2s; }

.right .audio-bubble .voice-bar:first-child { animation-delay: 0.2s; }
.right .audio-bubble .voice-bar:nth-child(2) { animation-delay: 0.1s; }
.right .audio-bubble .voice-bar:nth-child(3) { animation-delay: 0s; }

@keyframes voiceWave {
  0%, 100% { height: 36rpx; }
  50% { height: 24rpx; }
}

.voice-icon {
  width: 40rpx;
  height: 40rpx;
  margin-right: 8rpx;
  cursor: pointer;
}

.voice-time {
  font-size: 16px;
  color: #999;
  white-space: nowrap;
}

.right .voice-time {
  color: rgba(255, 255, 255, 0.8);
}

.audio-playing .voice-bar {
  animation: voiceWavePlaying 1.5s infinite ease-in-out;
}

@keyframes voiceWavePlaying {
  0%, 100% { height: 40rpx; background-color: #ff3b30; }
  50% { height: 20rpx; background-color: #ff9500; }
}

/* 左右文件样式适配 */
.left .file {
  margin-left: 10rpx;
}

.right .file {
  margin-right: 10rpx;
  background-color: #007AFF;
  color: #fff;
  box-shadow: 0 2rpx 8rpx rgba(0, 122, 255, 0.2);
}

.right .file .file-name {
  color: #fff;
}

/* 时间戳样式 */
.times {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 20rpx 0;
  color: #999;
  font-size: 24rpx;
}

 /* 长按复制样式反馈 */
.message-text:active {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 4rpx;
    padding: 2rpx 6rpx;
}